package java_thinking.unit_17._17_9_10;

import java_thinking.net.mindview.util.TextFile;

import java.util.List;

/**
 * @Desc:
 * @author: cww
 * @DateTime: 2019/4/18 9:16
 */

public class E15_WordCounter2 {
    public static void main(String[] args) {
        List<String> words = new TextFile("test3.txt","\\W+");
        SlowMap<String,Integer> map = new SlowMap<>();
        for (String word : words) {
            Integer freq = map.get(word);
            map.put(word,freq == null ? 1 : freq + 1);
        }
        System.out.println(map);
    }
}
